package com.sky.service.impl;

import com.sky.entity.Orders;
import com.sky.mapper.OrderMapper;
import com.sky.service.OrderTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

@Service
public class OrderTaskServiceImpl implements OrderTaskService {
    @Autowired
    private OrderMapper orderMapper;
    @Override
    public void orderstatus() {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime end = now.plusMinutes(-15);
        Map map =new HashMap();
        map.put("end" ,end);
        map.put("status", Orders.PENDING_PAYMENT);
        orderMapper.updatStatus(map);

    }

    @Override
    public void orderStatusComplete() {
        orderMapper.orderStatusComplete();

    }
}
